﻿
namespace LS.Api.Helper
{
    public enum ApiResult
    {
        /// <summary>
        /// 成功
        /// </summary>
        Success = 0,
        /// <summary>
        /// 无授权
        /// </summary>
        NoAuth = 1,
        /// <summary>
        /// 失败
        /// </summary>
        Fail = 2,
    }
    /// <summary>
    /// 自定义返回对象
    /// </summary>
    public class ApiJsonResult
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="code"></param>
        /// <param name="msg"></param>
        /// <param name="data"></param>
        public ApiJsonResult(ApiResult code, string msg, object data = null)
        {
            this.code = (int)code;
            this.msg = msg;
            this.data = data;
        }
        /// <summary>
        /// 状态码
        /// </summary>
        public int code { get; set; }
        /// <summary>
        /// 消息
        /// </summary>
        public string msg { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public object data { get; set; }

    }
}